function [ ] = radixconversion_tb()
    %http://baseconvert.com/
    I = [2 5 6];
    F = [ 3 4 ];
    s = 7;
    d = 3;
    ansv = 12011.11120222110010022021011102;
    o = vec2float(I,F);
    [I_c,F_c] = radixconversion(I,F,s,d);
    c_my = vec2float(I_c,F_c);
    assert(o,ansv,c_my, strcat(mat2str(I),'.',mat2str(F)),strcat(mat2str(I_c),'.',mat2str(F_c)));

    I = [24 15 6];
    F = [13 24];
    s = 31;
    d = 3;
    ansv = 1012021200.1022222202011122220222;
    o = vec2float(I,F);
    [I_c,F_c] = radixconversion(I,F,s,d);
    c_my = vec2float(I_c,F_c);
    assert(o,ansv,c_my, strcat(mat2str(I),'.',mat2str(F)),strcat(mat2str(I_c),'.',mat2str(F_c)));
    
    I = [4 6];
    F = [3 7 5];
    s = 10;
    d = 2;
    ansv = 101110.011;
    o = vec2float(I,F);
    [I_c,F_c] = radixconversion(I,F,s,d);
    c_my = vec2float(I_c,F_c);
    assert(o,ansv,c_my, strcat(mat2str(I),'.',mat2str(F)),strcat(mat2str(I_c),'.',mat2str(F_c)));

    I = [1 0 1 1 1 0];
    F = [0 1 1];
    s = 2;
    d = 10;
    ansv = 46.375;
    o = vec2float(I,F);
    [I_c,F_c] = radixconversion(I,F,s,d);
    c_my = vec2float(I_c,F_c);
    assert(o,ansv,c_my, strcat(mat2str(I),'.',mat2str(F)),strcat(mat2str(I_c),'.',mat2str(F_c)));
end

function [n] = vec2float(I,F)
    I = sum(10.^(length(I)-1:-1:0).*I); 
    F = sum(10.^(length(F)-1:-1:0).*fliplr(F)); 
    str = strcat(num2str(I), '.', fliplr(num2str(F)));
    n = str2num(str);
end

function [] = assert(o,ansv,my,str_vector1,str_vector2)
    if(abs(ansv-my) < 10^-10)
        fprintf('\tYes: %s => %s\n',str_vector1,str_vector2);
    else
        fprintf('\tNo : %d => %.32d, corrct is: %.32d (diff: %.32d)\n',o,my,ansv,abs(my-ansv));
    end
end